﻿using NHibernate.Criterion;

namespace Model.Repositories.Interest
{
    public class InterestRepository : Repository<Entities.Interest>
    {
        public Entities.Interest GetByTitle(string title)
        {
            var obj = Session.CreateCriteria<Entities.Interest>().Add(Restrictions.Eq("Title", title)).List<Entities.Interest>();
            if (obj != null && obj.Count == 1)
                return obj[0];
            return null;
        }
    }
}